package com.eboy.testcallphone;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    public final void btnCall(View v){
    	EditText edtPhoneNumber = (EditText) findViewById(R.id.edtPhoneNumber);
    	String phoneNumber = edtPhoneNumber.getText().toString();    	
    	Intent intent = new Intent();
    	intent.setAction("android.intent.action.CALL");
        intent.setData(Uri.parse("tel:" + phoneNumber));
        startActivity(intent);
    }
}
